package tjut.opp.testI14;

import java.util.Scanner;

public class YearDayTest {

	public static void main(String[] args) {
		int x=0;//年
		int y=0;//月
		int z=0;//日

		int sum=0;
		Scanner input=new Scanner(System.in);
		System.out.println("输入年：");
		x=input.nextInt();
		System.out.println("输入月：");
		y=input.nextInt();
		System.out.println("输入日：");
		z=input.nextInt();
		System.out.println("你想查询的是"+x+"年"+y+"月"+z+"日");
		if(x%400==0||(x%4==0)&&(x%100!=0)){
			switch(y){
			case 1:sum=z;break;
			case 2:sum=31+z;break;
			case 3:sum=60+z;break;
			case 4:sum=91+z;break;
			case 5:sum=121+z;break;
			case 6:sum=152+z;break;
			case 7:sum=182+z;break;
			case 8:sum=213+z;break;
			case 9:sum=244+z;break;
			case 10:sum=274+z;break;
			case 11:sum=305+z;break;
			case 12:sum=335+z;break;
			}
			
		}else{
			switch(y){
			case 1:sum=z;break;
			case 2:sum=31+z;break;
			case 3:sum=60+z-1;break;
			case 4:sum=91+z-1;break;
			case 5:sum=121+z-1;break;
			case 6:sum=152+z-1;break;
			case 7:sum=182+z-1;break;
			case 8:sum=213+z-1;break;
			case 9:sum=244+z-1;break;
			case 10:sum=274+z-1;break;
			case 11:sum=305+z-1;break;
			case 12:sum=335+z-1;break;
		}
	}
		System.out.println("这一天是本年的第"+sum+"天");
	}
}
